Analytical quaternion-based bias estimation algorithm for fast and accurate stationary gyro-compassing

This work introduces a novel approach to Strapdown Inertial Navigation System (SINS) alignment, distinct from recursive methods like Kalman filtering. The proposed methodology expedites bias error calculations by utilizing quaternion-based analytical relationships, which bypasses the slow convergence behavior associated with recursive algorithms, particularly in azimuth angle error estimation. In addition, the proposed approach demonstrates comparable accuracy to traditional fine alignment methods. Simulations and experiments validate that in contrast to the 10-min time requirement of traditional fine alignment methods (for azimuth angle estimation in stationary conditions), the proposed approach achieves the same accuracy within 20 s. However, limitations exist as the algorithm is applicable only in stationary conditions, and necessitating a high-grade IMU capable of measuring the earth’s rotation rate.

for alignment algorithms capable of accurately estimating initial attitude errors and sensor biases, given their significant impact on positional precision.
Initial alignment can be accomplished by processing data from the IMU solely 3 or with the aid of supplementary sensors such as Global Positioning System (GPS) 4,5 , doppler velocity log 6,7 , camera 8,9 , odometer 10 or the low-orbit satellite data 11 .However, In strategic applications such as satellite launch vehicles (VLS), it is crucial to perform alignment without any external assistance 12 and this study proposes a new initial alignment algorithm utilizing solely IMU data, commonly referred to as self-alignment.
Navigation accuracy in SINS predominantly relies on the initial azimuth's precision.Hence, azimuth alignment is a crucial issue in navigation 1,2, [13][14][15][16] .The typical initial alignment procedure involves a two-step self-alignment process, including coarse and fine alignment 14 .The primary objective of the coarse alignment is to serve as an initial reference for the fine alignment process by providing approximate estimations of the misalignment angles within a narrow range of a few degrees 17,18 .
The coarse alignment can be categorized into two primary methodologies, distinguished by their reliance on unique observation vectors.One approach utilizes apparent gravity to determine the initial attitude of SINS, while the other is based on apparent velocity 19 .In recent years, there has been a growing interest in optimizationbased alignment methods.These approaches link the SINS alignment and attitude determination problems using infinite vector observations over a continuous time interval.For instance, in 20 , the q-method, commonly employed to address the attitude determination problem, is used to heuristically transform the SINS alignment problem to an optimization problem of finding the minimum eigenvector.However, it cannot estimate the sensor biases and lacks a dependable quality indicator for evaluating the accuracy of OBA's attitude.The need for a reliable quality index has been thoroughly investigated in 21 , where a real-time attitude accuracy indicator for the subsequent fine alignment is introduced through the covariance analysis of the OBA approach.
Although gyroscope biases are the most critical factors that affect the azimuth alignment accuracy of the INSs 22 , there exist limited approaches that take into account the Inertial IMU's bias error in coarse alignment stage 23 .The approach presented in 24 studies the estimation of biases and introduces an innovative coarse bias estimation method by employing orthonormality constraints for precise bias estimation.Although the algorithm has significantly reduced in-field bias estimation time, in applications requiring extremely high accuracy, this algorithm is not a suitable choice to perform the whole initial alignment procedure, as it doesn't eliminate the need for a fine alignment stage.The approach outlined in 25 determined the gyroscope bias independently of the accelerometer bias by incorporating a recursive Bayesian filter known as MUSQUE.However, accuracy will be compromised with a single iteration of the recursive filter and several iterations will be necessary.Ref. 22 proposes a gyroscope multi-position bias estimation method that relies on attitude-tracking information and addresses the ill conditioned problems in gyroscope observation equations across three orientations.However, its practicality is constrained as the procedure necessitates orienting the IMU in at least three distinct positions, which restricts the method from applying to stationary vehicles.
The primary objective of the fine alignment procedure is to enhance the initial attitude estimation of the vehicle while also estimating any uncompensated biases in the inertial sensors (referred to as calibration) 26 .The fine alignment problem has drawn the interest of researchers globally, and the exploration for more rapid stationary alignment and bias estimation algorithms has been thoroughly documented in the existing literature.Literature 27 introduces a strategy centered on expanding measurements to achieve a more rapid and accurate estimation of sensor biases.Despite its effectiveness, this approach does not enhance the convergence rate of platform misalignments, as it relies on unobservable uncompensated biases beyond the Kalman filter's estimation capability.In 28 , a novel method is presented for initial alignment, utilizing a Kalman filter for fine alignment and incorporating horizontal gravity acceleration into measurement equations to improve attitude angle tracking.Meanwhile 29 , proposes a multi-rate self-alignment algorithm to boost the Kalman filter's bias estimation capability.Ref. 30 suggests a design principle for a dual-axis rotating SINS to address slow convergence and low accuracy during initial alignment and self-calibration.Conventional fine alignment algorithms exhibit divergence in cases where the initial azimuth angle error is significant.The main reason for such behavior is their inherent strong nonlinearity and limited observability, as outlined in prior works 31,32 .In recent years, Novel approaches using the theory of the Lie group have been introduced to immune the fine alignment algorithm to the initial large misalignment.These methods employ different types of Kalman filtering, such as the linear Kalman filter 33 , the invariant Kalman filter 34,35 , and the state transformation extended Kalman filter 36 , to improve convergence speed and enhance overall stability.
All fine alignment methods use recursive estimation algorithms such as the Kalman filter to adjust the velocity, attitude, and sometimes position based on the difference between the INS outputs and a reference 26 .Ref. 15,16 have performed observability analysis of the attitude error model with velocity measurement.They have proved that the azimuth angle error is not fully observable, requiring a substantial duration for the filter to estimate it accurately 37 .Hence, the recursive filtering method has the drawback of a slow convergence speed for the azimuth angle.
The literature suggests that all coarse alignment algorithms demonstrate swift convergence; however, their drawback lies in their inadequate accuracy for initializing a SINS algorithm.Conversely, fine alignment procedures typically necessitate 10 min to converge to an acceptable azimuth angle calculation under stationary conditions 24 .Consequently, there is a need for a seamless technique in SINS alignment that combines the rapidity of coarse alignment with the accuracy of fine alignment methods.
This paper introduces a novel stationary SINS alignment procedure that precisely determines the azimuth angle within 20 s.Consequently, this study makes two significant contributions: 1-The proposed SINS alignment technique eliminates the need for recursive estimation algorithms, such as Kalman-based filtering methods, which can be hindered by a slow convergence rate when estimating azimuth angle error.Instead, analytical quaternion-based relationships were employed to determine bias errors, providing a significantly faster alignment duration; and 2-The algorithm calculates inertial sensor biases with very high accuracy and thus the bias compensation procedure is performed excellently.
Bias errors often degrade the inertial sensor's quality and can significantly affect SINS performance; By accurately determining them, the introduced method allows for precise calculation of azimuth angle in SINS.Furthermore, over time, inertial sensors tend to experience bias-instability 38 .Therefore, developing a fast bias estimation technique presents an opportunity to disregard the bias-instability tendencies of inertial sensors, resulting in an expedited alignment process.
The accuracy of the proposed method in estimating azimuth angle and gyroscope biases is the same as the maximum accuracy achievable in traditional fine alignments.In addition, the algorithm's execution time was investigated through numerical simulation in 200 different conditions.Finally, the analytical bias estimation relationships were validated experimentally using an FOG-based IMU in 50 different stationary conditions.As a result, the algorithm presents an alternative to conventional approaches for initial alignment in SINS equipped with high-grade IMUs.
The rest of this paper is organized as follows: Sect."Proposed method" introduces the proposed method for the initial alignment of SINS as an algorithm.In Sect."Numerical simulation and experimental results", the proposed method's time performance and precision are verified through simulation and experiment.Finally, in Sect."Conclusion", the advantages and disadvantages of the suggested method are discussed in detail.

Proposed method
The purpose of this section is to present a comprehensive explanation of a new algorithm designed to align SINS systems quickly and precisely.Conventional alignment processes involve two main stages: leveling and north-finding 26 .In the proposed algorithm, the leveling Euler angles are assumed to be provided by a triad of accelerometers.Hence, the proposed algorithm focuses solely on determining the geographical north.
It can be demonstrated that the accuracy of the north-finding algorithm is closely tied to the accuracy of the inertial block.In theory, if the error of the inertial block is eliminated (ideal sensor), the error of the alignment algorithm will also approach zero.Hence, the algorithm's accuracy can be enhanced by estimating and compensating for sensor errors.
The proposed algorithm improves the traditional methods by using analytical relations to find and correct the errors of the gyroscopes.Instead of using a slow and complex fine alignment stage like other optimal-filteringbased algorithms, the outlined methodology calculates the initial attitude Euler angles in three phases.This process involves two simple coarse alignment phases and one error correction phase.This way, the algorithm can achieve high accuracy in a shorter time.The algorithm combines the advantages of both fast but inaccurate coarse alignment methods and slow but accurate fine alignment methods.The authors call this new algorithm "Quaternion-Based Differential Alignment" abbreviated as QBDA and show how it works in Fig. 1.In this figure, Figure 1 demonstrates that the proposed algorithm is divided into three phases.The second phase repeats itself until it reaches the maximum time limit of t max , but the first and third phases only happen once.The first and third phases utilize a conventional coarse alignment algorithm, which is not covered in this article but can be found in 26 .It is essential to emphasize that the proposed algorithm relies on initializing the heading through a traditional direct gyrocompassing method.Consequently, the algorithm's functionality is limited to high-grade IMUs.Hence, The IMU which is used in the gyrocompass algorithm should be as accurate to measure the Earth's rotation rate.On the other hand, the second phase of Fig. 1 is the main focus of this research and is responsible for calculating bias errors in gyroscopes using analytical relations.In other words, the proposed algorithm refines the gyroscope sensors' outputs by estimating their biases and calculates the north direction using a conventional coarse alignment algorithm.Hence, it can eliminate the need for time-consuming fine alignment techniques by employing analytical relations.Algorithm 1 represents all phases and their execution sequence in more detail.
Algorithm 1. North finding algorithm According to Algorithm 1, "first phase" receives tilt angles ( ϕ, θ ) and raw gyro data [ ωBI ] B as inputs and runs a conventional coarse alignment algorithm to return navigation to body frame transformation matrix ( [T] BN rough ) as a rough estimation of INS attitude.
Phase two starts with receiving current time (t), Initial guess ( [T] BN rough ) and gyro raw data ( [ ωBI ] B ).After that, gyro biases ( [δω BI ] B ) are estimated through a series of analytical equations inside an iterative loop.The user sets the maximum time of the iteration.Phase two contents are discussed deeply in Sect."Second phase".
The third phase starts when the second phase runs out of time ( t max ).It removes the biases ( [δω BI ] B ) that were calculated from the gyro raw outputs following that does a standard coarse alignment, similar to the phase one.Phase three output is the exact INS attitude estimate shown by the navigation to body transformation matrix ( [T] BN exact ).

Second phase
This section offers an in-depth explanation of the "second phase" procedure as outlined in Algorithm 1.It also encompasses the derivation of the analytical equations employed within this procedure.In Fig. 2, you can observe the various components of the second stage procedure, which include the attitude propagation block, the attitude error calculation block, a summation block for the integration of attitude quaternion errors, and the primary contribution of this research -the bias functions block.The bias functions block is crucial in extracting inertial sensor bias errors using quaternion-based analytical equations.Subsequent subsections will introduce these bias calculator functions and provide an extensive description of each block.

Quaternion propagation
Quaternion propagation block in Fig. 2 propagates attitude one step forward.Consider the quadrature vector of quaternions as follows: In the Eq. 1, q BN expresses the status of frame B with respect to frame N .It is shown that the relationship of the vector of quaternions with [ ωBI ] B is as follows 39 : (1) In addition [ω EI ] N is Earth rotation rate with respect to inertial frame and expressed in the navigation frame and [T] BN rough is the initial guess of transformation matrix from navigation frame to body frame (provided by first phase course alignment block).Providing initial conditions for the quaternion vector, performed as follows: Where ϕ 0 , θ 0 and ψ 0 are provided by [T] BN rough through the first phase coarse alignment block.

Quaternion-based bias calculator
The bias functions block in Fig. 2 calculates gyro biases through a series of analytical equations.The deviation in the attitude quaternion is defined as follows (Supplementary Information): The time derivative of deviation quaternion is obtained by the chain rule as follows: Also, the time derivative of the inverse quaternion is obtained as follows 41 : Utilizing Eqs. 9 and 10, 9 is written: The kinematic differential equation for the quaternion q is represented by: Substituting Eq. 12 into Eq.11 and utilizing q = q ⊗ q , q is obtained as follows 40 : The above equation is rewritten as: Where [δ ωBN ] B and [δ� BN ] B are respectively transpose and skew-symmetric form of gyro error vector [δω BN ] B which is defined in the stationary condition as follows: By substituting Eq. 15 into Eq.14 (which is used for propagation of attitude error not the attitude), we will have: The expansion of the above equation is as follows: www.nature.com/scientificreports/ The initial conditions of the above differential equations are obtained from the first phase coarse alignment introduced in Fig. 2. Integrating the above relations, results in: The above relation is rewritten as follows: The above relation includes four equations and three unknowns and is rewritten as: Where and and Based on the least squares method, the solution of Eq. 20 is as follows 42 : By substituting Eqs.21, 22 and 23 in Eq. 20 and solving the resulted equation through Eq. 24, we would have:  www.nature.com/scientificreports/Where δ ωx , δ ωy and δ ωz are estimated gyro biases of x , y and z axes respectively.If q is assumed an acceptable approximation of q , the quaternion error vector can be written as follows: Considering the assumption of Eq. 28, the denominator of the Eqs. 25, 26 and 27 will be simplified as follows: Where t f is the maximum time of integration that can be specified by user.
Finally by placing relation 29 in Eqs.25-27, bias functions equations will be: Equations 30-32 are embedded in the "Bias Functions" block as depicted in Fig. 2.

Numerical simulation and experimental results
The extracted relationships are validated in this section through numerical simulation and experimental results.Firstly, the relationships are tested using numerical simulations to ensure their accuracy and reliability.Secondly, experiments are conducted to validate the extracted relationships further in a real-world.

Numerical simulation
A comprehensive analysis was performed through numerical simulations to validate the accuracy and reliability of the proposed method; a total of 200 working points were generated for this purpose.These working points encompass randomly generated stationary conditions for the inertial block (latitude, longitude, height, Euler angles), and distinct error coefficients were applied to the gyro model based on the Eq. 4 at each scenario.Tables 1  and 2 demonstrate the first five working points of the simulation.Next, the simulation is conducted using the set above of working points in stationary conditions.Firstly, the sensors' output was averaged for 20 s while they were entirely at rest.Then, the proposed algorithm is executed for a duration of 1 second.the sampling rate of the quaternion propagation procedure is 100 Hz.

Accuracy analysis
In Fig. 3, the accuracy of the proposed QBDA method is compared with the maximum achievable accuracy of traditional fine alignment methods in calculating the north direction.As depicted in Fig. 3, the accuracy of the QBDA method is comparable to that of conventional fine alignment algorithms.
In 15 , the observable and unobservable parameters in the fine alignment algorithm are specified.According to this reference, the unobservable parameters encompass the bias of north and east accelerometers, as well as the east gyroscope bias.Conversely, the north and down gyroscope biases are identified as observable.As a result, (27)      it is anticipated that the proposed method will demonstrate the capability to estimate both the north gyro bias δ gn and the down gyro bias δ gd as accurate as a conventional fine alignment algorithm.Figures 4 and 5 depict the effective estimation of the north gyro bias δ gn and the down gyro bias δ gd achieved through the QBDA method, respectively.Lastly, Figure 6 illustrates the QBDA method's estimation of the east-channel-gyro bias ( δ ge ).As previously indicated, δ ge is unobservable; consequently, its estimation remains unattainable.Therefore, the differential alignment algorithm has approximated the value of this unobservable parameter as zero.

Execution time
The proposed algorithm comprises three distinct phases, with only phase 1 being time-intensive.During phase 1, the outputs of the IMU undergo an averaging process lasting approximately 20-30 s to mitigate the impact of environmental noise.This results in three averaged values for accelerometers and three for gyroscopes.Phases 2 and 3 are not time-intensive because they work with the average numbers prepared in Phase 1.The computational processes in phases 2 and 3 are performed in a fraction of time.The algorithm was run on a computing system equipped with an Intel Core i5 CPU running at 1.6GHz, coupled with 8GB of RAM, Table 3 presents the subsequent run-time procedure: Figure 7 illustrates a comparison of convergence times between the proposed method and a traditional Kalman filter-based fine alignment.Notably, the QBDA method achieves an estimation of the north direction within 20 s, superior than the traditional fine alignment, which demands approximately 10 min to converge to the desired accuracy.www.nature.com/scientificreports/

Experimental results
The proposed alignment method was validated in real-world conditions using FOG100 GEM Elettronica gyrocompass data.This system includes a triad of fiber optical gyroscopes along with a triad of quartz accelerometers.Tables 4 and 5 represent gyroscopes and accelerometers specifications respectively.
Measurements were acquired at a 100 Hz interval.In an iterative process, the longest allowable run time for the second phase, denoted as t max , was determined to be 0.05 s through trial and error.
Data were recorded while the device was positioned on a three-axis calibration turn table.During the experiment, the true IMU biases can be easily computed according to the earth's angular velocity, which is transformed into the turn table coordinate system.
Figures 8 and 9 illustrate a comparison between the estimated biases of the north and down gyros with the exact values in 50 different scenarios.Evidently, the proposed algorithm accurately estimates the biases of both the north and down gyroscopes in real situations.However, due to the unobservability of the east gyroscope bias, the proposed algorithm cannot estimate it.

Conclusion
This study introduces an innovative approach for SINS alignment, distinctively avoiding dependence on recursive estimation techniques like Kalman-based filtering.Recursive algorithms, particularly susceptible to slow convergence in azimuth angle error estimation, are bypassed.Instead, the methodology employs analytical relationships to calculate bias errors, resulting in a swifter estimation process.Furthermore, the accuracy of the proposed method is similar to that of the traditional fine alignment methods.Simulation and experimental studies consistently validate the proposed approach's superior convergence speed and equivalent accuracy compared to traditional fine alignment algorithms.In contrast to traditional methods, which demand over 10 min for azimuth angle estimation in stationary conditions 24 , the proposed approach achieves precise calculations of azimuth angle and gyroscope sensor biases within a mere 20 s, matching or surpassing the maximum accuracy achieved by traditional fine alignments.
A disadvantage of the proposed algorithm is that it is not applicable for a swaying or in-motion INS alignment, and its application is limited to stationary alignment and bias estimation.In addition, the first phase of the algorithm consists of a direct gyro-compassing algorithm as a coarse alignment, which provides the second phase with a rough estimation of attitude.According to the literature, to enable north-finding, a gyroscope needs a bias instability lower than the earth's rotation rate 43 .Hence, the proposed algorithm requires a high-grade IMU that can measure earth's rotation rate.

ϕ
and θ denote the roll and pitch Euler angles.ωBI B represents the measurements from the gyroscopes, while δω BI B signifies the gyroscopes' bias errors.ω BI B corrected corresponds to the corrected gyroscope measurements.Additionally, [T] BN rough indicates the coarse alignment output, which provides a rough estimate of the transformation matrix from the body frame to the navigation frame.Finally, [T] BN exact denotes the ultimate output of the proposed method, offering an exact estimation of the initial INS attitude represented by a body to navigation frame transformation matrix.

Figure 1 .
Figure 1.General view of the quaternion-based Differential Alignment process.
https://doi.org/10.1038/s41598-024-66282-9www.nature.com/scientificreports/Where in the stationary condition we have:In Eq. 3, [ ωBI ] B denotes gyroscope measurements and is modeled as follows:Based on the Eq. 4, the gyroscope error model includes misalignment coefficients that are denoted as ( and scale factor coefficients for the x , y , and z axes are denoted as ( s g x , s g y , s g z ) respectively.The bias error coefficients for the x , y , and z axes are represented as ( b gx , b g y , b g z ).Additionally, the noise components for the x , y , and z axes are denoted as (

Figure 3 .
Figure 3. Accuracy comparison of fine and the proposed QBDA algorithms.

Figure 4 .
Figure 4. Estimation of the north-channel-gyro bias in the proposed QBDA algorithm.

Figure 5 .
Figure 5. Estimation of the down-channel-gyro bias in the proposed QBDA algorithm.

Figure 6 .
Figure 6.Estimation of the east-channel-gyro bias in the proposed QBDA algorithm.

Table 1 .
Generated test conditions-Position and Attitude of the IMU.

Table 2 .
Generated test conditions-Gyro model coefficients.